import sys
import os
import json


data = {
	"folders": [
		{
			"path": ""
		}
	],
	"settings": {}
}



def Create_Vscode(dir):
    outfilepath = os.path.join(dir,"vscode.code-workspace")
    outpath = dir
    data['folders'][0]['path'] = outpath
    
    with open(file=outfilepath,mode="w+",encoding="utf-8") as file:
        file.write(json.dumps(data,indent=4))
        
    



if __name__ == "__main__" :

    print("=" * 50)
    print("=" * 50)
    print("=" * 50)
    print(f"提示 : pre_gen_project.py 【Start】!\n")

    currentDir = os.getcwd()
    Create_Vscode(currentDir)
    
    
    
    print("我是项目生成前执行的Python程序!")
    print(f"我的位置是 : {__file__}")




    print(f"提示 : pre_gen_project.py 【End】!")
    print("=" * 50)
    print("=" * 50)
    print("=" * 50)
    print("\n\n")
